<template>
    <div>
        <el-form :model="form">
            <quill-editor v-model="form.spuDetails.description"></quill-editor>
            <el-upload
                    action="http://api.blb.com/api/upload-api/upload"
                    :show-file-list="false"
                    :on-success="handleAvatarSuccess">
                <el-button size="small" type="primary">点击上传</el-button>
            </el-upload>
            <el-form-item label="赠品清单">
                <el-input v-model="form.spuDetails.packingList" placeholder="请输入赠品清单"></el-input>
            </el-form-item>
            <el-form-item label="售后服务">
                <el-input v-model="form.spuDetails.afterService" placeholder="请输入售后服务"></el-input>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    //引入quill-edit编辑器
    import 'quill/dist/quill.core.css'
    import 'quill/dist/quill.snow.css'
    import 'quill/dist/quill.bubble.css'
    import { quillEditor } from 'vue-quill-editor'

    export default {
        name: "GoodsDetails",
        components:{
          quillEditor
        },
        props:{
            form:{
                type:Object
            }
        },
        methods:{
            handleAvatarSuccess(res, file) {
                this.form.spuDetails.description += "<img src='"+res.url+"'>";
            }
        }
    }
</script>

<style scoped>

</style>